/**
 * Created by tom on 2017/5/7.
 */
var mongoose = require('mongoose')
var db = require('../../server/db')

var modelName = 'active'

var schema = new mongoose.Schema({
    type: {type: Number, default: 1},  // 类型， 1 用户单向动态   2 用户互动  3 用户反馈  4 管理员发布习题  5 其他普通动态
    active: {
        handler: {
            id: {type: mongoose.Schema.ObjectId},
            name: {type: String}
        },
        targeter: {
            id: {type: mongoose.Schema.ObjectId},
            name: {type: String}
        },
        content: {type: String,},
        activity: {
            type: {type: Number},
            test: {
                title: {type: String},
                id: {type: mongoose.Schema.ObjectId}
            },
            post: {
                title: {type: String},
                id: {type: mongoose.Schema.ObjectId}
            }
        },
        test: {
            title: {type: String},
            id: {type: mongoose.Schema.ObjectId}
        },
        post: {
            title: {type: String},
            id: {type: mongoose.Schema.ObjectId}
        }

    }
}, {timestamps: true})

var model = db.model(modelName, schema)


module.exports = model